package gitee.blacol.myIdUtil.exception;

import java.util.List;

public class PropNotExists extends Exception{
    private String message;
    public PropNotExists(List<String> notExistList,Class clazz){
        StringBuilder stringBuilder=new StringBuilder("字段");
        StringBuilder fields=new StringBuilder();
        for (String s:notExistList){
            fields.append(s).append("、");
        }
        String step1 = fields.substring(0, fields.length() - 1);
        stringBuilder.append(step1).append("不存在于类").append(clazz.getName()).append("中");
        message=stringBuilder.toString();
    }

    @Override
    public String getMessage() {
        return message;
    }
}
